<?php

/**
 * CategoriaController - The default controller class
 * 
 * @author
 * @version 
 */

class Logado_ProfessorController extends AppBaseLogadoController
{
	/**
	 * The default action - show the home page
	 */
	public function init()
	{
		parent::init();
		
		$estadocivil = new estadocivil();
		$this->view->estadocivil = $estadocivil->listar();
		
		$sexo = new sexo();
		$this->view->sexo = $sexo->listar();
		
		$banco = new banco();
		$this->view->banco = $banco->listar();
		
		$instituicao = new instituicao();
		$this->view->instituicao = $instituicao->listar();
		
		$resposta = new resposta();
		$this->view->resposta = $resposta->listar();
		
		$instancia = new instancia();
		$this->view->instancia = $instancia->listar();
		
		$estado = new estado();
		$this->view->estado = $estado->listar();
		
		$municipio = new municipio();
		$this->view->municipio = $municipio->listar();
	}
	
    public function indexAction() 
    {
    	
    	
    }
    public function cadastrarAction() 
    {
    }
    
    public function editarAction()
    {
    	$professor = new professor();
    	$this->view->dadosprofessor = $professor->pegaprofessor($this->_request->getParam("idprofessor"));
    }
    
    public function salvarAction()
    {
    	if($this->_request->isPost()){
	    	$professor = new professor();
	    	$professor->salvar($_POST);
	    	
	    	$this->_redirect("/logado/professor/listar");
    	}
    }
    
    public function listarAction()
    {
    	$professor = new professor();
    	$this->view->professor = $professor->listar();
    }
    
}
